package com.itheima.mysort;

public class A04_RecursionDemo2 {
    public static void main(String[] args) {
        //递归求阶乘
        int num=6;
        int number = getNum(num);
        System.out.println(number);

    }
    public static int getNum(int num) {
        //递归出口
        if(num==2){
            return 2;
        }
        //递归简化
        return num*getNum(num-1);
    }
}
